//
//  HomeCellTwo.m
//  FD
//
//  Created by Yasin on 2018/10/12.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "HomeCellTwo.h"
@interface HomeCellTwo()
@property (weak, nonatomic) IBOutlet UIImageView *iconIv; //图标
@property (weak, nonatomic) IBOutlet UILabel *nameLb;//标题
@property (weak, nonatomic) IBOutlet UILabel *priceLb;//3.价格
@property (weak, nonatomic) IBOutlet UILabel *saledLb;//4.已经销售

@end

@implementation HomeCellTwo

- (void)awakeFromNib {
    [super awakeFromNib];
 
    //已售隐藏
    self.saledLb.hidden = YES;
    
    //12-31文字颜色和背景色
    self.nameLb.textColor = [UIColor whiteColor];
    self.nameLb.backgroundColor = [UIColor rb_colorHex:0x000000 alpha:0.65];
}

- (void)setHomeModel2:(HomeModel *)homeModel2 {
    _homeModel2 = homeModel2;
    
    NSURL *picUrl = [NSURL URLWithString:homeModel2.thumbnail];
    //记得占位图没有写鸥
    [self.iconIv sd_setImageWithURL:picUrl placeholderImage:nil];
    self.nameLb.text = [NSString stringWithFormat:@" %@",homeModel2.title];
    
    self.priceLb.text = [NSString stringWithFormat:@" €%.1f",[homeModel2.currentPrice floatValue]];
    
    //国际化
    NSString *soldstr = NSLocalizedString(Home_Sold, @"已售");
    self.saledLb.text= [NSString stringWithFormat:@"%@:%@",soldstr,homeModel2.sale];
}
@end
